package org.csu.onlineedubackend.dto;

import lombok.Data;
import java.util.List;

@Data
public class PageResponseDTO<T> {
    private List<T> records;       // 数据列表
    private long total;            // 总记录数
    private long size;             // 每页大小
    private long current;          // 当前页码
    private long pages;            // 总页数
    
    public PageResponseDTO(List<T> records, long total, long size, long current) {
        this.records = records;
        this.total = total;
        this.size = size;
        this.current = current;
        this.pages = (total + size - 1) / size; // 计算总页数
    }
} 